package com.lufei.dh.ExList.Adapter;

import android.content.Context;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lufei.dh.ExList.MainActivity;
import com.lufei.dh.R;

import java.util.List;

/**
 * 版权：易金卡沃 版权所有
 * <p>
 * 作者：lufeifei
 * <p>
 * 创建日期：2018/6/9
 * <p>
 * 描述：
 * <p>
 * 修订历史：
 */
public class Adapter_Main extends BaseQuickAdapter<MainActivity.bean_xx, BaseViewHolder> {
    Context context;

    public Adapter_Main(@Nullable List<MainActivity.bean_xx> data, Context context) {
        super(R.layout.item_list, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, MainActivity.bean_xx item) {
        if (item.isD()) {
            helper.setImageResource(R.id.iv, R.mipmap.arrow_b);
            helper.setBackgroundColor(R.id.card_view,context.getResources().getColor(R.color.colorAccent));
        } else {
            helper.setImageResource(R.id.iv, R.mipmap.arrow_r);
            helper.setBackgroundColor(R.id.card_view,context.getResources().getColor(R.color.colorPrimary));
        }
    }
}
